﻿using Saisie_des_prélèvements.Models;
using System;
using System.Linq;
using System.Collections.ObjectModel;
using System.Collections.Generic;

namespace Saisie_des_prélèvements.ViewModels
{
    public class ZoneViewModel : ViewModelBase
    {
        #region Properties
        public int zone_id { get; set; }
        public string zone_code { get; set; }
        public string zone_label { get; set; }
        public int user_create { get; set; }
        public DateTime user_date { get; set; }
        #endregion Properties

        public List<ZoneViewModel> GetZoneSelection()
        {
            var db = new SQLite.SQLiteConnection(App.DBPath);
            List<ZoneViewModel> result = db.Query<ZoneViewModel>(
                "SELECT zone_id, zone_code, zone_label FROM k_zone_geographic ORDER BY zone_code"
                );

            return result;
        }
    }
}
